using Beaker.OpenCube.Render.Maths;

namespace Beaker.OpenCube.Render.Shapes
{
	public interface IShape
	{
		/// <summary>
		/// Computes the intersection with the given ray.
		/// </summary>
		/// <param name="scene">The scene.</param>
		/// <param name="ray">The ray to compute an intersection with.</param>
		/// <returns>
		/// An intersection or <c>null</c> when there was no intersection.
		/// </returns>
		Intersection ComputeIntersection( Scene scene, Ray ray );
	}

	public abstract class Shape
		: IShape
	{
		protected Shape()
		{
		}

		/// <summary>
		/// Computes the intersection with the given ray.
		/// </summary>
		/// <param name="scene">The scene.</param>
		/// <param name="ray">The ray to compute an intersection with.</param>
		/// <returns>
		/// An intersection or <c>null</c> when there was no intersection.
		/// </returns>
		public abstract Intersection ComputeIntersection( Scene scene, Ray ray );
	}
}